#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "startdlg.h"
#include "about.h"
#include <QMainWindow>
#include <QFileDialog>
#include <QAxObject>
#include <QTimer>
#include <QVector>
#include <QObject>
#include <QDebug>
#include <QMap>
#include <QDir>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(StartDlg *sdlg,QWidget *parent = 0);
    ~MainWindow();

    void closeEvent(QCloseEvent *);
    void getAllList();
    void getModelInfo();
    void startOutput();

public slots:
    void exception_1();
signals:
    void closed();

private slots:
    void on_inFileButton_clicked();

    void on_inFileButton_2_clicked();

    void on_inFileButton_3_clicked();

    void on_exportButton_clicked();

    void setVisibleNum(bool b);

    void on_aboutBtn_clicked();

private:
    Ui::MainWindow *ui;
    QAxObject *word;
    QAxObject *excel;
    QMap<QString,QString> list;
    QAxObject *worksheet;
    QString inExcel;
    QString inWord;
    QString outDir;
    QString ModelName;
    QString ModelNum;
    bool isWPS;
    int count,
        row_start,
        col_start;
    void initExcel(const QString& path);
    const QString getCellByExcel(int row,int col);
    bool WordStrReplace(const QString& replace_as,const QString replace_to,QAxObject *word);

    void initWord(const QString& path);

};

#endif // MAINWINDOW_H
